<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, adminUser-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
          <div class="layui-form-item">
              <label class="layui-form-label">求职意向ID</label>
              <div class="layui-input-block">
                  <input type="text" id="wantedId" name="wantedId"   autocomplete="off" placeholder="请输入求职意向ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">个人信息ID</label>
              <div class="layui-input-block">
                  <input type="text" id="personalId" name="personalId"   autocomplete="off" placeholder="请输入个人信息ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">教育背景ID</label>
              <div class="layui-input-block">
                  <input type="text" id="educationId" name="educationId"   autocomplete="off" placeholder="请输入教育背景ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">工作经历ID</label>
              <div class="layui-input-block">
                  <input type="text" id="workId" name="workId"   autocomplete="off" placeholder="请输入工作经历ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">项目经历ID</label>
              <div class="layui-input-block">
                  <input type="text" id="projectId" name="projectId"   autocomplete="off" placeholder="请输入项目经历ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">专业技能ID</label>
              <div class="layui-input-block">
                  <input type="text" id="skillsId" name="skillsId"   autocomplete="off" placeholder="请输入专业技能ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">自我评价ID</label>
              <div class="layui-input-block">
                  <input type="text" id="evaluateId" name="evaluateId"   autocomplete="off" placeholder="请输入自我评价ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">用户ID</label>
              <div class="layui-input-block">
                  <input type="text" id="userId" name="userId"   autocomplete="off" placeholder="请输入用户ID"
                         class="layui-input">
              </div>
          </div>

    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         wantedId:$("#wantedId").val(),
                         personalId:$("#personalId").val(),
                         educationId:$("#educationId").val(),
                         workId:$("#workId").val(),
                         projectId:$("#projectId").val(),
                         skillsId:$("#skillsId").val(),
                         evaluateId:$("#evaluateId").val(),
                           userId:$("#userId").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/WeChatUser/wechatResume/admin/addWechatResume",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 200) {
                        window.location.href=base+"/WeChatUser/wechatResume/admin/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#wantedId").val().length<1){
                       layer.msg("请输入求职意向ID");
                       return false;
                   }
                   if($("#personalId").val().length<1){
                       layer.msg("请输入个人信息ID");
                       return false;
                   }
                   if($("#educationId").val().length<1){
                       layer.msg("请输入教育背景ID");
                       return false;
                   }
                   if($("#workId").val().length<1){
                       layer.msg("请输入工作经历ID");
                       return false;
                   }
                   if($("#projectId").val().length<1){
                       layer.msg("请输入项目经历ID");
                       return false;
                   }
                   if($("#skillsId").val().length<1){
                       layer.msg("请输入专业技能ID");
                       return false;
                   }
                   if($("#evaluateId").val().length<1){
                       layer.msg("请输入自我评价ID");
                       return false;
                   }
                   if($("#userId").val().length<1){
                       layer.msg("请输入用户ID");
                       return false;
                   }
        }
    });

</script>
</body>
</html>